package com.yq.day18._06string;

/**
 * @author 3307235355@qq.com
 * @since 2022/06/19 21:04
 */
public class Demo05 {
    public static void main(String[] args) {
        // String s1 = "hello world!";
        // String s2 = "hello world!";
        // String s3 = "hello " + "world!";
        // System.out.println(s1 == s2);
        // System.out.println(s2 == s3);
        // System.out.println(s1 == s3);
        String s1 = "Hello";
        String s2 = "Hello";
        String s3 = "Hel" + "lo";
        String s4 = "Hel" + new String("lo");
        String s5 = new String("Hello");
        String s7 = "H";
        String s8 = "ello";
        String s9 = s7 + s8;


        System.out.println(s1 == s2);
        System.out.println(s1 == s3);
        System.out.println(s1 == s4);
        System.out.println(s1 == s9);
        System.out.println(s4 == s5);
        System.out.println(s3 == ("He" + "llo"));
    }
}
